package day06;

import java.util.Arrays;

public class Practice02 {
    public static void main(String[] args) {
        /*double[] arr = new double[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Math.random();
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        double max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        arr = Arrays.copyOf(arr, arr.length + 1);
        arr[arr.length-1] = max;
        System.out.println("最大数是"+max);*/
        say();
        sayHi('男');
        sayHello(17, '男');
        int a = getNum();
        System.out.println(a);
        double b = plus(2.2, 3.3);
        System.out.println(b);
         double[]  c  =  testArray(5);
        for (int i = 0; i < c.length ; i++) {
            System.out.println("小数位"+c[i]);
        }

    }

    public static void say() {
        System.out.println(0.22);
    }

    public static void sayHi(char gender) {
        System.out.println(gender);
    }

    public static void sayHello(int age, char gender) {
        System.out.println("wo " + age + "性别" + gender);
    }

    public static int getNum() {
        return 8;
    }

    public static double plus(double num1, double num2) {
        double num = num1 + num2;
        return num;
    }

    public static double[] testArray(int j) {
        double[] d = new double[j];
        for (int i = 0; i < d.length; i++) {
            d[i] = Math.random();
        }
        return d;
    }

}
